<?php
include_once('functions.inc.php');
session_start();
//--------

// Delete session from DB
Session::delete($_SESSION['ssid']);

// Destroy session on server
session_unset();
session_destroy();

// Destroy cookie
$_COOKIE['session'] = '';
$_COOKIE['user'] = '';
setcookie('session');
setcookie('user');

// Redirect
header('location:index.php');
?>